﻿var controllersModule = angular.module("freelancerModule.Controllers", []);

controllersModule.controller("headerController", function ($scope) {
    $scope.headerInfo = { title: "Pablo Chacón Luna - Web development - Freelancer", 
        description: "Servicio de desarrollo de páginas web, y compra de hosting  y dominios",
        author: "Pablo Andrey Chacón Luna",
    };
});

controllersModule.controller('CarouselDemoCtrl', function ($scope) {
    $scope.myInterval = 3500;
    //var slides = $scope.slides = [];
    //$scope.addSlide = function () {
    //    var newWidth = 600 + slides.length + 1;
    //    slides.push({
    //        image: 'http://placekitten.com/' + newWidth + '/300',
    //        text: ['More', 'Extra', 'Lots of', 'Surplus'][slides.length % 4] + ' ' +
    //          ['Cats', 'Kittys', 'Felines', 'Cutes'][slides.length % 4]
    //    });
    //};
    //for (var i = 0; i < 4; i++) {
    //    $scope.addSlide();
    //}
    $scope.slides = [
        {
            image: 'img/profile.png', text: "Diseño a su medida", link: "#portfolio", target: ""
        },
        {
            image: 'img/profile2.png', text: "Tecnologías de punta", link: "#contact", target: ""
        },
        {
            image: 'img/profile3.png', text: "Experiencia profesional", link: "https://cr.linkedin.com/in/pabloandreychaconluna/", target: "_blank"
        }
    ];
});

controllersModule.controller("mainCtrl", function ($scope, days) {
    $scope.day = days.today;
});

controllersModule.controller("introCtrl", function ($scope, days) {
    $scope.day = days.tomorrow;
});

controllersModule.controller("yearCtrl", function ($scope, years) {
    $scope.year = years.year;
});

controllersModule.controller("topicsMenuCtrl", function ($scope) {
    $scope.final = {
        author: "Pablo Andrey Chacon Luna", topics: [
            { name: "Intro", path: "#/intro" },
            { name: "Beyond Basics", path: "#/beyond" },
            { name: "Anatomy of Angular App", path: "#/anatomy" },
            { name: "Binding and Templates", path: "#/binding" },
            { name: "Using Element and Event Directives", path: "#/directives" },
            { name: "Working with Forms", path: "#/forms" },
            { name: "Using Controllers and Scopes", path: "#/controllersAndScopes" },
            { name: "Using Filters", path: "#/filters" },
            { name: "Working with Modules and Services", path: "#/modulesAndServicesView" }
        ]
    };
    $scope.startCarousel = function () {
        $('.carousel').carousel({
            interval: 5000 //changes the speed
        });
    }
});

controllersModule.controller("mainMenuCtrl", function ($scope) {
    $scope.mainMenu = {
        topics: [
            { name: "About", path: "#/about", divider: "⋅" },
            { name: "Services", path: "#/services", divider: "⋅" },
            { name: "Contact", path: "#/contact", divider: "" }
        ]
    };
});

controllersModule.controller("angularCtrl", function ($scope) {
    $scope.AngularFunction = function () {
        alert("Hello, saya angular function dipanggil oleh jquery");
    }
});
